from sqlalchemy import Column, Integer, String, DateTime, func, text
from forward.extend.sqlalchemy_sync import Base


class OperatorModel(Base):
    __tablename__ = "operator"
    __table_args__ = {"comment": "计调"}

    id = Column(Integer, primary_key=True, nullable=False)
    name = Column(String(50), nullable=True, comment="计调姓名")
    phone = Column(String(32), nullable=True, comment="电话")
    status = Column(Integer, nullable=True)
    entry_time = Column(DateTime, nullable=True, comment="入职时间")
    resignation_time = Column(DateTime, nullable=True, comment="离职时间")
    created_time = Column(DateTime, default=func.now(), comment="创建时间")
    deleted_time = Column(DateTime, comment="删除时间")
    created_by = Column(String(32), comment="创建者")
    deleted_by = Column(String(32), comment="删除者")
    is_deleted = Column(Integer, server_default=text("0"), comment="是否删除")
